home *** CD-ROM | disk | FTP | other *** search
/ Apple Service Source 1996 February / Service Source 2.0 1996 Companion.iso / AppleOrder / Program / AppleOrder CCL Folder / XUSA Hardware_MNP.CCL < prev    next >
Encoding:
Text File  |  1993-03-22  |  20.2 KB  |  626 lines  |  [TEXT/MPS ]

  1. !================================================================
  2. !    XUSA Hardware_MNP.CCL
  3. !================================================================
  4. !
  5. ! USA modem CCL script for modems with MNP or V.42 built into hardware
  6. !
  7. !    Change History-
  8. !        v1.0        09/21/90    gs:General Release Version
  9. !        v1.0.2        12/07/90    gs:Added bug fix for Printer Port ~MPRT selection
  10. !        v1.0.2        01/30/91    gs:Changed \N3 to \N2 reliable only connection
  11. !        v2.0d1        12/3/91        gs:Supports ModemCmd and ConnectStr parameters
  12. !        v2.0        9/7/92        gs:General Release Version
  13. !                    10/21/92    gs:Changed Label 80 code so that it tries at least 4 times to
  14. !                                sync up in Requesting Network attention before resetting modem.
  15. !        v2.0.1        2/3/93        gs:Changed "CARRIER" to "NO CARRIER", cleaned up CCL
  16. !                                and other miscellaneous changes
  17. !        v2.0.2        3/16/93        gs:added some delay to label 60 when waiting for a response
  18. !
  19. !    The following label ranges (0-255) are defined for all scripts:
  20. !
  21. !    Label        Function
  22. !    -----        --------
  23. !    0-19        Communications Setup
  24. !    20-39        Get a Modem
  25. !    40-59        Modem Setup
  26. !    60-79        Dialing
  27. !    80-99        Physical Connection
  28. !    100-119        GEIS Logon
  29. !    120-139        CICS
  30. !    140-159        APPM
  31. !    160-179        Online
  32. !    180-199        Terminate Session
  33. !    200-209        Cancel
  34. !    210-219        Hangup
  35. !    230-239        <UNUSED>
  36. !    240-255        Disconnect
  37. !
  38. !    Note:        Label 210 is the modem hangup sequence
  39. !                Label 240 is reserved as the start of the disconnect sequence
  40. !
  41. !================================================================================
  42. -LABEL 0    !***<Physical connection entry point>*** Initialize Communications
  43. !================================================================================
  44. !
  45. !    Set the Baud, Data, Stop, and Parity bits
  46. SerReset ~Baud ~Prty ~Xbts ~Sbts
  47. CTBParameter Port "~MPrt" 13
  48. DsplyMsg Opening the connection...
  49. !
  50. !    CTBOPEN [<LabelIfOpenFails>] [<LabelIfError>]
  51. CTBOpen 14 15        ! Open the Communications session
  52. !
  53. !    Flush any data, Initialize script variables and define Cancel label
  54. Flush                ! clear input buffer and ring buffer
  55. CanBtn 200            ! If user cancels, take the error return
  56. !
  57. SetVar 1 0            ! #of consecutive no responses to hangup command
  58. SetVar 2 0            ! #of consecutive no responses to modem configuration command
  59. SetVar 3 0            ! #of consecutive network contact failures.
  60. SetVar 4 0            ! #of logon validation failures
  61. SetVar 5 0            ! #of consecutive CICS90  failures
  62. SetVar 6 0            ! #of consecutive APPM failures
  63. SetVar 7 0            ! flag to indicate if connecting(0) or disconnecting(1)
  64. SetVar 8 0            ! not used
  65. !
  66. Jump 40                ! Go to Modem Selection and Setup
  67. !
  68. !*********
  69. -LABEL 13    !---<CTBParameter Port failed>---
  70. !*********
  71. Alert -1 CTBParameter Port caused an error.
  72. Exit -1                ! exit the script with an error.
  73. !
  74. !*********
  75. -LABEL 14    !---<CTBOpen failed>---
  76. !*********
  77. Alert -1 CTBOpen could not open communications.\13The serial port may already be in use.
  78. Exit -1                ! exit the script with an error.
  79. !
  80. !**********
  81. -LABEL 15    !---<CTBOpen err>---
  82. !**********
  83. Alert -1 CTBOpen caused an Communications Toolbox error.
  84. Exit -1                ! exit the script with an error.
  85. !
  86. !================================================================================
  87. -LABEL 40    !***<Modem Setup>*** Modem Reset and Setup
  88. !================================================================================
  89. DsplyPic 1
  90. DsplyMsg Making sure the modem is ready...
  91. Jsr 210                ! Hang up (just in case)
  92. SetVar 1 0            ! clear # hangup tries counter
  93. !
  94. !**********
  95. -LABEL 42    ! ---<Got modem attention>---
  96. !**********
  97. DsplyMsg Setting modem parameters...
  98. !    Clear all previous MatchStr's and setup the modem
  99. MatchStr 1 42 Dummy
  100. Wait 30
  101. !    Send modem setup commands
  102. Xmit ~HCMD\13
  103. MatchStr 1 60 OK
  104. Wait 300               ! wait up to 5 secs for a response
  105. IncVar 2            ! increment # modem setup tries
  106. IfVar 2 3 44        ! if 3 tries, display Modem Configuration Alert
  107. DsplyMsg Modem not responding to setup commands. Retrying...
  108. Jump 42                ! else try modem setup again
  109. !
  110. !**********
  111. -LABEL 44    ! ---<Modem configuration err>---
  112. !**********
  113. Bell
  114. Alert 200 The modem is not responding to setup commands.\13Turn the modem off and then on again before retrying.
  115. SetVar 2 0            ! clear # modem setup tries
  116. Jump 40                ! reset modem and try again
  117. !
  118. !================================================================================
  119. -LABEL 60    !***<Modem ready>*** Dial phone
  120. !================================================================================
  121. DsplyMsg Dialing ~Fone...
  122. DsplyPic 2
  123. !    Clear all previous MatchStr's (No comments on same line as MatchStr's)
  124. MatchStr 1 60 Dummy
  125. SetVar 2 0            ! clear #modem setup tries
  126. !    Turn off Xon/Xoff flow control
  127. CTBParameter Handshake XON/XOFF 78
  128. Wait 30                ! Give modem .5 secs to get ready before sending the attention chars
  129. Xmit ATD~Tone~Fone\13
  130. !    Look for one of the following expected responses
  131. MatchStr 1 80 ~GSTR
  132. MatchStr 2 62 ERROR
  133. MatchStr 3 66 NO CARRIER
  134. MatchStr 4 70 BUSY
  135. MatchStr 5 74 NO DIAL
  136. Wait 2000            ! wait about 30 secs for a response
  137. !
  138. !**********
  139. -LABEL 62    !---<No response or ERROR from modem>---
  140. !**********
  141. IncVar 3            ! Increment # dial attempts counter
  142. IfVar 3 4 64        ! if 4 attempts, display No Dial Response Alert
  143. DsplyMsg Modem does not respond to Dial command. Retrying...
  144. Jump 40                ! reset modem and try again
  145. !
  146. !**********
  147. -LABEL 64    !---<No dial response err>---
  148. !**********
  149. Bell
  150. Alert 200 The modem is not responding to dial command.\13Make sure your modem is connected to a phone line.
  151. SetVar 3 0            ! clear # dial attempts counter
  152. Jump 40                ! reset modem and try again
  153. !
  154. !**********
  155. -LABEL 66   !---<No Carrier>---
  156. !**********
  157. IncVar 3            ! Increment # dial attempts counter
  158. IfVar 3 4 68        ! if 4 attempts, display No Carrier Alert
  159. DsplyMsg No Carrier with phone number dialed. Retrying...
  160. Jump 40                ! reset modem and try again
  161. !
  162. !**********
  163. -LABEL 68    !---<No carrier err>---
  164. !**********
  165. Bell
  166. Alert 200 Cannot detect carrier signal after dialing.\13Make sure the phone number provided is correct.
  167. SetVar 3 0            ! clear # dial attempts counter
  168. Jump 40                ! reset modem and try again
  169. !
  170. !**********
  171. -LABEL 70    !---<busy>---
  172. !**********
  173. IncVar 3            ! Increment # dial attempts counter
  174. IfVar 3 4 72        ! if 4 attempts, display Busy Alert
  175. DsplyMsg Phone number dialed is busy. Pausing before retrying...
  176. Wait 300            ! wait 5 secs
  177. DsplyMsg Retrying...
  178. Jump 40                ! reset modem and try again
  179. !
  180. !**********
  181. -LABEL 72    !---<Busy err>---
  182. !**********
  183. Bell
  184. Alert 200 All network access lines are in use.\13Try again later.
  185. SetVar 3 0            ! clear # dial attempts counter
  186. Jump 40                ! reset modem and try again
  187. !
  188. !**********
  189. -LABEL 74    !---<No Dialtone>---
  190. !**********
  191. IncVar 3            ! Increment # dial attempts counter
  192. IfVar 3 4 76        ! if 4 attempts, display No Dialtone Alert
  193. DsplyMsg Modem reports no dial tone. Retrying...
  194. Jump 40                ! reset modem and try again
  195. !
  196. !**********
  197. -LABEL 76   !---<No dialtone Error>---
  198. !**********
  199. Bell
  200. Alert 200 Modem reports no dial tone.\13Make sure your modem is connected to a phone line.
  201. SetVar 3 0            ! clear # dial attempts counter
  202. Jump 40                ! reset modem and try again
  203. !
  204. !*********
  205. -LABEL 78    !---<CTBParameter XON/XOFF failed>---
  206. !*********
  207. Alert -1 CTBParameter XON/XOFF caused an error.
  208. Exit -1                ! exit the script with an error
  209. !
  210. !================================================================================
  211. -LABEL 80    !***<Establish Physical Connection>*** Send H's to identify us to network
  212. !================================================================================
  213. DsplyMsg Requesting network attention...
  214. !    Look for one of the following expected responses
  215. MatchStr 1 84 NO CARRIER
  216. MatchStr 2 100 U#
  217. Xmit HH
  218. Wait 600            ! Allow 10 seconds for the U# to show up
  219. IncVar 3            ! No U#, increment # dial attempts counter
  220. IfVar 3 4 82        ! if 4 attempts, display No U# Alert
  221. Jump 80                ! else try again
  222. !
  223. !**********
  224. -LABEL 82    !---<No U#>---
  225. !**********
  226. Bell
  227. Alert 200 Unable to get the network's attention.\13Make sure you have the correct phone number.
  228. SetVar 3 0            ! clear # dial attempts counter
  229. Jump 40                ! reset modem and try again
  230. !
  231. !**********
  232. -LABEL 84    !---<Line dropped>---
  233. !**********
  234. IncVar 3            ! Increment # dial attempts counter
  235. IfVar 3 4 86        ! if 4 attempts, display Line Dropped Alert
  236. DsplyMsg Carrier signal dropped before network recognition. Retrying...
  237. Jump 40                ! reset modem and try again
  238. !
  239. !**********
  240. -LABEL 86   !---<Line dropped Err>---
  241. !**********
  242. Bell
  243. Alert 200 Carrier signal dropped before network recognition.\13Try again.
  244. SetVar 3 0            ! clear # dial attempts counter
  245. Jump 40                ! reset modem and try again
  246. !
  247. !================================================================================
  248. -LABEL 100    !***<GEIS logon>***
  249. !================================================================================
  250. !
  251. DsplyMsg Physical Connection established. Logging on to network...
  252. DsplyPic 3
  253. SetVar 3 0            ! clear # dial attempts counter
  254. Wait 6                ! wait 0.1 sec
  255. Flush                ! clear input buffer
  256. !    Note: leave 2 spaces between ~Dist and ~Numb
  257. Xmit ~User,~Dist  ~Numb,~Ridn\13
  258. !
  259. !    Look for one of the following expected responses
  260. MatchStr 1 104 NO CARRIER
  261. MatchStr 2 106 DISCONNECTED
  262. MatchStr 3 120 ===>
  263. MatchStr 6 108 N FAULT,
  264. MatchStr 7 108 T FORMAT,
  265. MatchStr 8 110 L DENIED
  266. MatchStr 9 112 BUSY
  267. MatchStr 10 112 DOWN
  268. Wait 600            ! wait up to 10 seconds for a response
  269. IncVar 4            ! Increment # logon attempts counter
  270. IfVar 4 3 102        ! if 3 tries, display No Login Response alert 
  271. DsplyMsg No logon response from network. Retrying...
  272. Jump 100            ! try again
  273. !
  274. !*********
  275. -LABEL 102    !---<No Logon response>---
  276. !*********
  277. Bell
  278. Alert 200 No logon response from network.\13Try again.
  279. SetVar 4 0            ! clear # logon attempts counter
  280. Jump 40                ! reset modem and try again
  281. !
  282. !*********
  283. -LABEL 104    !---<Carrier dropped>---
  284. !*********
  285. IncVar 4            ! Increment # login attempts counter
  286. IfVar 4 3 105        ! if 3 attempts, display Carrier dropped alert
  287. DsplyMsg Carrier signal dropped during network logon. Retrying...
  288. Jump 40                ! reset modem and try again
  289. !
  290. !*********
  291. -LABEL 105    !---<Carrier dropped Err>---
  292. !*********
  293. Bell
  294. Alert 200 Carrier signal dropped during network logon.\13Try again.
  295. SetVar 4 0            ! clear # logon attempts counter
  296. Jump 40                ! reset modem and try again
  297. !
  298. !*********
  299. -LABEL 106    !---<Session disconnected>---
  300. !*********
  301. IncVar 4            ! Increment # logon attempts counter
  302. IfVar 4 3 107        ! if 3 attempts, display Session disconnected alert
  303. DsplyMsg Network connection dropped during network logon. Retrying...
  304. Jump 40                ! reset modem and try again
  305. !
  306. !*********
  307. -LABEL 107    !---<Session disconnected Err>---
  308. !*********
  309. Bell
  310. Alert 200 Network connection dropped during network logon.\13Try again.
  311. SetVar 4 0            ! clear # logon attempts counter
  312. Jump 40                ! reset modem and try again
  313. !
  314. !*********
  315. -LABEL 108    !---<Validation fault>---
  316. !*********
  317. IncVar 4            ! Increment # logon attempts counter
  318. IfVar 4 3 109        ! see if limit of 3 is exceeded.
  319. DsplyMsg Network rejected your identification. Retrying...
  320. Wait 60                ! wait 1 sec
  321. Jump 100            ! retry GEIS login (only case where we don't reset)
  322. !
  323. !*********
  324. -LABEL 109    !---<validation fault err>---
  325. !*********
  326. Bell
  327. Alert 200 Your network identification has been rejected.\13Check Setup to make sure your identification is correct.
  328. SetVar 4 0            ! clear # logon attempts counter
  329. Jump 40                ! reset modem and try again
  330. !
  331. !*********
  332. -LABEL 110    !---<Denied by host>---
  333. !*********
  334. IncVar 4            ! Increment # logon attempts counter
  335. IfVar 4 3 111        ! if 3 attempts, display Network Problem alert
  336. DsplyMsg Network host equipment problem detected. Retrying...
  337. Jump 40                ! reset modem and try again
  338. !
  339. !*********
  340. -LABEL 111    !---<Denied by host err>---
  341. !*********
  342. Bell
  343. Alert 200 Network host equipment problem detected.\13Try again.
  344. SetVar 4 0            ! clear # logon attempts counter
  345. Jump 40                ! reset modem and try again
  346. !
  347. !*********
  348. -LABEL 112    !---<MARK3K access busy/down>---
  349. !*********
  350. IncVar 4            ! Increment # logon attempts counter
  351. IfVar 4 3 113        ! if 3 attempts, display Network Busy alert
  352. DsplyMsg Network equipment busy/down. Retrying...
  353. Jump 40                ! reset modem and try again
  354. !
  355. !*********
  356. -LABEL 113    !---<MARK3K access busy/down err>---
  357. !*********
  358. Bell
  359. Alert 200 Network equipment busy or down.\13Try again.
  360. SetVar 4 0            ! clear # logon attempts counter
  361. Jump 40                ! reset modem and try again
  362. !
  363. !================================================================================
  364. -LABEL 120    !***<MARK3000 prompt>*** Invoke CICS
  365. !================================================================================
  366. !
  367. DsplyMsg Requesting access to network subsystem...
  368. DsplyPic 4
  369. Wait 6                ! wait 0.1 secs
  370. Flush                ! clear input buffer
  371. !
  372. Xmit ~CICS\13
  373. !    Look for one of the following expected responses
  374. MatchStr 3 140 READY
  375. !    To overcome a network problem, the following label was changed from 124 to 126
  376. !    MatchStr 4 124 T BOUND
  377. MatchStr 4 126 T BOUND
  378. MatchStr 5 126 UNRECOGN
  379. MatchStr 6 126 ===>
  380. Wait 3600            ! Allow 60 secs for the expected responses to show up
  381. IncVar 5            ! Timeout, so increment # CICS tries counter
  382. IfVar 5 2 122        ! if 3 tries, display No Response alert
  383. DsplyMsg No response to network subsystem request. Retrying...
  384. Jump 40                ! reset modem and try again
  385. !
  386. !*********
  387. -LABEL 122    !---<No CICS err>---
  388. !*********
  389. Bell
  390. Alert 200 No response to network subsystem request.\13Try again.
  391. SetVar 5 0            ! clear # CICS tries counter
  392. Jump 40                ! reset modem and try again
  393. !
  394. !*********
  395. -LABEL 124    !---<Session not bound err>---
  396. !*********
  397. Bell
  398. Alert 200 Network CICS subsystem needs to be started.\13Please contact the Apple USA helpline immediately.
  399. Jump 200            ! jump to cancel routine
  400. !
  401. !*********
  402. -LABEL 126    !---<Invalid application>---
  403. !*********
  404. IncVar 5            ! Increment # CICS tries counter
  405. IfVar 5 3 127        ! if 3 tries, display Invalid Application alert
  406. DsplyMsg Network subsystem request has been rejected. Retrying...
  407. Wait 60                ! wait 1 sec
  408. Flush
  409. Jump 120            ! try to access CICS again
  410. !
  411. !*********
  412. -LABEL 127    !---<Invalid application err>---
  413. !*********
  414. Bell
  415. Alert 200 The network subsystem request has been rejected.\13Try again.
  416. SetVar 5 0            ! clear # CICS tries counter
  417. Flush
  418. Jump 40                ! reset modem and try again
  419. !
  420. !================================================================================
  421. -LABEL 140    !***<CICS ready>*** Start APPM transaction
  422. !================================================================================
  423. !
  424. DsplyMsg Requesting access to distribution center ~Dist...
  425. DsplyPic 5            ! Highlight box 5 on screen
  426. SetVar 5 0            ! clear # CICS tries counter
  427. !                    ! Send what needs to be sent
  428. Xmit ~Epgm~Dist\13
  429. !    Look for one of the following expected responses
  430. Wait 12                ! wait 0.2 secs
  431. Flush                ! clear input buffer
  432. !    Look for one of the following expected responses
  433. MatchStr 3 160 C100
  434. MatchStr 4 144 INVALID
  435. Wait 3600            ! Allow 60 secs for the expected responses to show up
  436. !
  437. IncVar 6            ! Timeout, so Increment # APPM tries counter
  438. IfVar 6 2 142        ! if 2 tries, display No Transaction alert
  439. DsplyMsg No response to distribution center access request. Retrying...
  440. Jump 40                ! reset modem and try again
  441. !
  442. !*********
  443. -LABEL 142    !---<No transaction response>---
  444. !*********
  445. Bell
  446. Alert 200 No response to distribution center access.\13Try again.
  447. SetVar 6 0            ! reset # APPM tries counter
  448. Jump 40                ! reset modem and try again
  449. !
  450. !*********
  451. -LABEL 144    !---<Invalid transaction>---
  452. !*********
  453. IncVar 6            ! Increment # APPM tries counter
  454. IfVar 6 2 145        ! if 2 tries, display Invalid Transaction alert
  455. DsplyMsg Distribution center access request rejected. Retrying...
  456. Jump 40                ! reset modem and try again
  457. !
  458. !*********
  459. -LABEL 145    !---<Invalid transaction err>---
  460. !*********
  461. Bell
  462. Alert 200 Distribution center access request rejected.\13Check Setup to make sure your identification is correct.
  463. SetVar 6 0            ! reset # APPM tries counter
  464. Jump 40                ! reset modem and try again
  465. !
  466. !================================================================================
  467. -LABEL 160    !***<Online>***
  468. !================================================================================
  469. !
  470. Wait 60                ! wait 1 sec
  471. DsplyMsg Accessing the distribution center ~Dist...
  472. DsplyPic 6            ! Highlight box 6 on screen
  473. !    C9 = pass msg thru GE, 899 = Echo cmd
  474. Xmit C9899Ole\13
  475. !    Look for one of the following expected responses
  476. MatchStr 2 162 C5
  477. MatchStr 3 170 Ole\13
  478. Wait 7200            ! wait 2 minutes for echo back or distribution center nonavail msg
  479. !
  480. !*********
  481. -LABEL 162    !---<no luck this time>--- 
  482. !*********
  483. DsplyMsg Distribution center is not available...
  484. Jsr 180                ! terminate session
  485. Bell
  486. Alert -1 Distribution center is not available.\13Please try again later.
  487. Jump 200            ! exit to Cancel routine
  488. !
  489. !*********
  490. -LABEL 170    !---<Success, we’re in, so exit>--- 
  491. !*********
  492. Wait 30                ! wait 0.5 secs
  493. Flush                ! clear input buffer
  494. Exit 0                ! exit the script normally
  495. !
  496. !================================================================================
  497. -LABEL 180-199    !***<Terminate Session>***
  498. !================================================================================
  499. !
  500. !*********
  501. -LABEL 180    !---<Terminate session>--- 
  502. !*********
  503. !    send Abnormal disconnect command
  504. Xmit C3\13
  505. !    Look for one of the following expected responses
  506. MatchStr 1 182 U#
  507. Wait 300            ! wait 5 secs
  508. Return
  509. !
  510. !*********
  511. -LABEL 182    !---<Say bye>---
  512. !*********
  513. Wait 6                ! wait 0.1 sec and sign off the network
  514. Xmit BYE\13
  515. Return
  516. !
  517. !================================================================================
  518. -LABEL 200    !***<Cancel Routine>***
  519. !================================================================================
  520. DsplyMsg Cancelling...
  521. Flush
  522. Wait 30                ! wait 0.5 secs
  523. Exit -1                ! exit the script with an error
  524. !
  525. !================================================================================
  526. -LABEL 210    !***<Hang up phone Routine>***
  527. !================================================================================
  528. !
  529. !    Look for one of the following expected responses
  530. MatchStr 1 222 CARRIER
  531. SetVar 1 0            ! clear # hangup tries counter
  532. SetVar 2 0            ! clear # modem config tries counter and reuse for MNPStatus checks
  533. !
  534. !*********
  535. -LABEL 220    !---<Hang up the phone subroutine>---
  536. !*********
  537. Wait 60                ! wait 1 sec (beginning guard time) and send +++ (escape)
  538. Xmit +
  539. Xmit +
  540. Xmit +
  541. Wait 60                ! wait 1 more sec (end guard time)
  542. Flush                ! clear input buffer and tell modem to hang up verbosely
  543. Xmit ATV1H\13
  544. !    Look for one of the following expected responses
  545. MatchStr 2 222 OK
  546. MatchStr 3 224 ERROR
  547. Wait 120            ! wait 2 secs
  548. Jump 224            ! test for error or no response            
  549. !
  550. !*********
  551. -LABEL 222    !---<Reset the modem>---
  552. !*********
  553. !
  554. IfVar 7 0 229        ! If NOT disconnecting, bypass the modem reset.
  555. !                      This aids in script debugging so we dont reset modem 1st time.
  556. Flush                ! Flush the buffer and send Hayes Reset Modem command
  557. Xmit ATZ\13
  558. !    Look for one of the following expected responses
  559. MatchStr 2 229 OK
  560. MatchStr 3 224 ERROR
  561. Wait 180            ! wait 3 secs
  562. !
  563. !*********
  564. -LABEL 224    !---<Error or just no response>---
  565. !*********
  566. IncVar 1            ! Increment # hangup tries counter
  567. IfVar 1 3 225        ! if 3 tries, display error alert and try again
  568. Jump 220            ! try to hangup again
  569. !
  570. !*********
  571. -LABEL 225    !---<Error>---
  572. !*********
  573. IfVar 7 1 229        ! If disconnecting, just return.
  574. Alert 200 The modem is not responding to the hangup command.\13Turn it off and then on again before retrying.
  575. SetVar 1 0            ! clear # hangup tries counter
  576. Jump 220            ! try to hangup again
  577. !
  578. !*********
  579. -LABEL 229    !---<Return from the Hangup sequence>---
  580. !*********
  581. Wait 60                ! wait 1 sec
  582. Flush                ! clear input buffer
  583. Return
  584. !
  585. !================================================================================
  586. -LABEL 230-239    !***<UNUSED>***
  587. !================================================================================
  588. !
  589. !================================================================================
  590. -LABEL 240    !***<Disconnection Sequence>***
  591. !================================================================================
  592. !
  593. !    If the connection is closed, we cant hangup, so just exit
  594. !    CTBIFCLOSED <LabelToGotoIfConnectionClosed>
  595. CTBIFCLOSED 246
  596. !
  597. SetVar 7 1            ! We're disconnecting, so set the flag
  598. !    Look for one of the following expected responses
  599. MatchStr 1 242 U#
  600. MatchStr 2 244 NO CARRIER
  601. Wait 60                ! wait 1 sec
  602. Jump 244            ! and hang up the phone
  603. !
  604. !*********
  605. -LABEL 242    !---<Sign off the network>---
  606. !*********
  607. Xmit BYE\13
  608. Wait 120            ! wait 2 secs
  609. !
  610. !*********
  611. -LABEL 244    !---<Hang up the phone>---
  612. !*********
  613. SetVar 1 0            ! clear the # hangup tries counter
  614. Jsr 210                ! Execute the Hang-up subroutine
  615. !    No CTBClose here because the connection is closed externally from the script
  616. !    in case we exited the script with an error before completion.
  617. Flush                ! clear input buffer
  618. Exit 0                ! exit the script normally
  619. !
  620. !*********
  621. -LABEL 246    !---<Connection Was Closed>---
  622. !*********
  623. Flush                ! clear input buffer
  624. Exit 0                ! exit the script normally
  625. ###
  626.